<?php 
    include('./request.php');
    include('./config.php');
    $goods_id = $result->goods_id;
    $goods_name = $result->goods_name;
    $goods_model = $result->goods_model;
    $user_id = $result->user_id;
    $market_name = $result->market_name;
    try{
        $pdo = new PDO($dsn,$user,$pass);
        $pdo->beginTransaction();
        $sql = "update purchaseorder set accState = '已收货' where goods_id = ".$goods_id." and user_id = ".$user_id." and goods_name = '".$goods_name."' and goods_model = '".$goods_model."' and market_name = '".$market_name."'";
        $res = $pdo->prepare($sql);
        $res->execute();
        if($res){
            echo "ok";
            $pdo->commit();
        }else{
            $pdo->rollBack();
            echo "error";
        }
    }catch(PDOException $e){
        $pdo->rollBack();
        echo "error";
    }
?>